package QianFeng09.ProducterCustomerDemo;

//生产者
public class Producer implements Runnable {
    private Food food;

    public Producer(Food food) {
        this.food = food;
    }
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            if (i % 2 == 0) {
                food.set("宫保鸡丁", "有嚼劲，够味！");
            } else {
                food.set("佛跳墙", "大补，滋阴补阳！");
            }
        }
    }
}
